Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upload add download icon #18664

Merged
merged 25 commits into from Sep 11, 2019
Merged

feat: upload add download icon #18664

merged 25 commits into from Sep 11, 2019

Conversation

crazyair
Copy link
Member

@crazyair crazyair commented Sep 4, 2019

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English upload add download,remove icon , remove close icon
🇨🇳 Chinese upload 添加下载、删除图标,删除 close 图标

☑️ Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Copy link

@tests-checker tests-checker bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add tests to make sure this change works as expected?

@netlify
Copy link

netlify bot commented Sep 4, 2019

Deploy preview for ant-design ready!

Built with commit eaf7201

https://deploy-preview-18664--ant-design.netlify.com

@crazyair crazyair mentioned this pull request Sep 4, 2019
14 tasks
@buildsize
Copy link

buildsize bot commented Sep 4, 2019

File name Previous Size New Size Change
package-lock.json 851.16 KB 848.89 KB -2.27 KB (0%)

@afc163
Copy link
Member

afc163 commented Sep 4, 2019

  • 超长文件名的样式截断没有兼容好。

原本的:

image

现在的:

image

@afc163
Copy link
Member

afc163 commented Sep 4, 2019

  • changelog 里漏掉了删除图标❌的更新。

components/upload/index.en-US.md Outdated Show resolved Hide resolved
components/upload/index.zh-CN.md Outdated Show resolved Hide resolved
@crazyair
Copy link
Member Author

crazyair commented Sep 4, 2019

@afc163 1、超长文件名 2、log 已改

@dengfuping
Copy link
Contributor

image
这什么错误啊

  • @qq645381995 这个不影响测试,先忽略就好。但现在 demo 测试是挂了的,需要修复下。

image

@crazyair
Copy link
Member Author

crazyair commented Sep 5, 2019

好的

@crazyair
Copy link
Member Author

crazyair commented Sep 6, 2019

  • 超长文件名的样式截断没有兼容好。

原本的:

image

现在的:

image

改了

@afc163
Copy link
Member

afc163 commented Sep 11, 2019

image

默认情况下有点浪费空间,可以hover上去真正出现 icon 了才改 padding。

image

@crazyair
Copy link
Member Author

crazyair commented Sep 11, 2019

image

默认情况下有点浪费空间,可以hover上去真正出现 icon 了才改 padding。

image

添加完了,全部判断了显示的 icon 的数量去计算 padding-right

@crazyair
Copy link
Member Author

@afc163 这是什么代码又报错了?

@mansion-sun
Copy link

onDownload里面需要自定义下载方法吗?目前的下载按钮打开csv文件连接时进入新标签页,但是不触发下载

@yoyo837
Copy link
Contributor

yoyo837 commented Jan 10, 2020

@sunxia628 那是因为你的浏览器支持打开csv文件,如果不支持就会触发下载。你可以试试右键链接,另存为。。。

@mansion-sun
Copy link

mansion-sun commented Jan 10, 2020

没有,打开后是空页面,也并没有访问到文件,另存为存储的是当前页面的html

@yoyo837
Copy link
Contributor

yoyo837 commented Jan 10, 2020

那你这不是链接的那种。

@mansion-sun
Copy link

mansion-sun commented Jan 10, 2020

我尝试了按钮这种是可以下载的,
<a href="https://www.w3school.com.cn/i/w3school_logo_white.csv" download="w3school_logo_white.csv">
同样的链接点击组件的下载按钮就打开了空页面!

@mansion-sun
Copy link

mansion-sun commented Jan 16, 2020

showUploadList:Boolean or { showPreviewIcon?: boolean, showRemoveIcon?: boolean, showDownloadIcon?: boolean }可以指定是否显示按钮可以传reactDom就能够实现定制化开发了,不知道这个功能是自己没发现,还是使用错误,希望可以支持!
@yoyo837
@afc163
路径替换为绝对路径就可以了,自动拼接的路径携带路由,这个可能还是项目问题,但是Upload组件可以支持自定义下载按钮可以不必钻这坑

@@ -16,6 +16,7 @@ export default class UploadList extends React.Component<UploadListProps, any> {
showInfo: false,
},
showRemoveIcon: true,
showDownloadIcon: true,
Copy link
Member

@afc163 afc163 Feb 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉应该改成默认为 false,咨询去掉的反馈比较多。@crazyair

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,帮忙改成 false 把,这个需要后端支持,一般场景用不到。

@crazyair
Copy link
Member Author

onDownload里面需要自定义下载方法吗?目前的下载按钮打开csv文件连接时进入新标签页,但是不触发下载

对,默认的行为就是打开连接,浏览器支持的格式会渲染出来,不支持的会触发下载。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants